﻿using System.Data.Entity;

namespace Noria.Web.MyMSDN.Models
{
    internal class MmContext : DbContext
    {
        public MmContext()
            : base("Name=mymsdn")
        {
            Configuration.LazyLoadingEnabled = true;
        }

        public DbSet<Category> Categories { get; set; }
        public DbSet<Family> Families { get; set; }
        public DbSet<File> Files { get; set; }
        public DbSet<Checksum> Checksum { get; set; }
        public DbSet<History> Histories { get; set; }
        public DbSet<Locale> Locales { get; set; }

        public int SyncChecksum()
        {
            return Database.ExecuteSqlCommand("call sp_syncchecksum()");
        }
    }
}